Build cleanups. Build dynamic libs as -fPIC always.
Signed-off-by: Keir Fraser <keir.fraser@cl.cam.ac.uk>
$(MAKE) -C sv install
clean:
+ $(MAKE) -C check clean
$(MAKE) -C libxutil clean
$(MAKE) -C libxc clean
$(MAKE) -C misc clean
XEN_LIBXC = $(XEN_ROOT)/tools/libxc
XEN_LIBXUTIL = $(XEN_ROOT)/tools/libxutil
+COMPILE_ARCH ?= $(shell uname -m | sed -e s/i.86/x86_32/)
+TARGET_ARCH ?= $(COMPILE_ARCH)
+
ifeq ($(TARGET_ARCH),x86_32)
CFLAGS += -m32 -march=i686
LDFLAGS += -m elf_i386
CFLAGS += -m64
LDFLAGS += -m elf_x86_64
endif
+
+%.opic: %.c
+ $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $<
+
+%.o: %.c
+ $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
-ifndef BUILD_PIC_LIBS
-ifeq ($(wildcard /etc/debian_version),)
-BUILD_PIC_LIBS=n
-else
-BUILD_PIC_LIBS=y
-endif
-endif
-
INSTALL = install
INSTALL_PROG = $(INSTALL) -m0755
INSTALL_DATA = $(INSTALL) -m0644
mv staging/i386/*.rpm .
rm -rf staging
-$(PIC_OBJS): %.opic: %.c
- $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $<
-
libxc.a: $(OBJS)
$(AR) rc $@ $^
libxc.so.$(MAJOR): libxc.so.$(MAJOR).$(MINOR)
ln -sf $< $@
-ifeq ($(BUILD_PIC_LIBS),y)
libxc.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
$(CC) -Wl,-soname -Wl,libxc.so.$(MAJOR) -shared -o $@ $^ -L../libxutil -lxutil -lz
-else
-libxc.so.$(MAJOR).$(MINOR): $(LIB_OBJS)
- $(CC) -Wl,-soname -Wl,libxc.so.$(MAJOR) -shared -o $@ $^ -L../libxutil -lxutil -lz
-endif
-include $(DEPS)
-ifndef BUILD_PIC_LIBS
-ifeq ($(wildcard /etc/debian_version),)
-BUILD_PIC_LIBS=n
-else
-BUILD_PIC_LIBS=y
-endif
-endif
-
XEN_ROOT = ../..
INSTALL = install
INSTALL_DATA = $(INSTALL) -m0644
all: check-for-zlib
$(MAKE) $(LIB)
-$(PIC_OBJS): %.opic: %.c
- $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $<
-
libxutil.so: libxutil.so.$(MAJOR)
ln -sf $^ $@
libxutil.so.$(MAJOR): libxutil.so.$(MAJOR).$(MINOR)
ln -sf $^ $@
-ifeq ($(BUILD_PIC_LIBS),y)
libxutil.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
$(CC) -Wl,-soname -Wl,libxutil.so.$(MAJOR) -shared -o $@ $^
-else
-libxutil.so.$(MAJOR).$(MINOR): $(LIB_OBJS)
- $(CC) -Wl,-soname -Wl,libxutil.so.$(MAJOR) -shared -o $@ $^
-endif
libxutil.a: $(LIB_OBJS)
$(AR) rc $@ $^
clean:
$(RM) *.o $(TARGET) *~
+
+$(TARGET): $(TARGET).c
+ $(CC) $(CFLAGS) -o $@ $<
$(INSTALL_DATA) include/public/io/*.h $(DESTDIR)/usr/include/xen/io
$(INSTALL_DATA) include/public/COPYING $(DESTDIR)/usr/include/xen
-clean:
+clean: delete-unfresh-files
$(MAKE) -C tools clean
$(MAKE) -C common clean
$(MAKE) -C drivers clean
$(MAKE) -C arch/$(TARGET_ARCH) clean
- rm -f include/asm *.o $(TARGET)* *~ core include/xen/compile.h
+ rm -f include/asm *.o $(TARGET)* *~ core
rm -f include/asm-*/asm-offsets.h
rm -f tools/figlet/*.o tools/figlet/figlet